import {IndexRoute, Route} from 'react-router';
import App from './pages/App';

// Hook for server
if (typeof require.ensure !== 'function') {
    require.ensure = function(dependencies, callback) {
        callback(require)
    }
}

//各模块页面
const Home=(location, cb)=>{require.ensure([], require=>{cb(null, require('./pages/Home').default);});};
const About=(location, cb)=>{require.ensure([], require=>{cb(null, require('./pages/About').default);});};

const routes = (
    <Route path="/" component={App}>
        <IndexRoute getComponent={Home}/>
        <Route path="/about" getComponent={About}/>
    </Route>
);
export default routes